package com.tian.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月14日 22:22
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 * <p>
 * 消息消费者
 */

@Component
public class Consumer {

    /**
     * 订单超时死信队列监听
     */
    @RabbitListener(queues = {"${rabbitmq.order.pay.overtime.dead.queue.name}"}, containerFactory = "rabbitListener")
    public void orderPayOvertimeDeadListener(@Payload Long orderId) {
        //查询订单
        System.out.println("消费者：" + orderId);
    }
}


